using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ActionButton : MonoBehaviour
{
    public KeyCode actionKey;
    private SlotUI slotUI;
    private void Awake()
    {
        slotUI = GetComponent<SlotUI>();
    }

    // Update is called once per frame
    void Update()
    {
        // 按下快捷道具键且背包格子中有物品
        if (Input.GetKeyDown(actionKey) && slotUI.itemUI.GetItem())
        {
            // 使用背包格子的物品
            slotUI.UseItem();
        }
    }
}
